﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;

namespace LynxWebLog.Areas.Pages.ViewModels
{
    public class PageEntry
    {
        public PageData pd { get; set; }
        public BlogData bd { get; set; }

        public string dateCreatedString { get; set; }

        public PageEntry() { }

        public PageEntry(PageData pd, BlogData bd)
        {
            this.pd = pd;
            this.bd = bd;
        }

        public string Url(RequestContext req)
        {
            return string.Format("{0}://{1}{2}/Pages/{3}/{4}/?pgName={5}", req.HttpContext.Request.Url.Scheme,
                    req.HttpContext.Request.Url.Authority, HttpRuntime.AppDomainAppVirtualPath, bd.username, bd.blogname, pd.title);
        }

    }
}